package cn.org.book.shop.article.domain;

import cn.org.book.shop.common.annotation.Excel;
import cn.org.book.shop.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.List;


/**
 * 文章信息，存储已发布的文章对象 ap_article
 *
 * @author julywhj
 * @date 2020-11-17
 */
public class ApArticle extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    private Long id;

    /**
     * 标题
     */
    @Excel(name = "标题")
    private String title;

    /**
     * 文章作者的ID
     */
    @Excel(name = "文章作者的ID")
    private Long authorId;

    /**
     * 作者昵称
     */
    @Excel(name = "作者昵称")
    private String authorName;

    /**
     * 文章所属频道ID
     */
    @Excel(name = "文章所属频道ID")
    private Long channelId;

    /**
     * 频道名称
     */
    @Excel(name = "频道名称")
    private String channelName;

    /**
     * 文章布局
     * 0 无图文章
     * 1 单图文章
     * 2 多图文章
     */
    @Excel(name = "文章布局")
    private Integer layout;

    /**
     * 文章标记
     * 0 普通文章
     * 1 热点文章
     * 2 置顶文章
     * 3 精品文章
     * 4 大V 文章
     */
    @Excel(name = "文章标记")
    private Integer flag = 0;

    /**
     * 文章标签最多3个 逗号分隔
     */
    @Excel(name = "文章标签最多3个 逗号分隔")
    private String labels;

    /**
     * 点赞数量
     */
    @Excel(name = "点赞数量")
    private Integer likes = 0;

    /**
     * 收藏数量
     */
    @Excel(name = "收藏数量")
    private Integer collection = 0;

    /**
     * 评论数量
     */
    @Excel(name = "评论数量")
    private Integer comment = 0;

    /**
     * 阅读数量
     */
    @Excel(name = "阅读数量")
    private Integer views = 0;

    /**
     * 省市
     */
    @Excel(name = "省市")
    private Long provinceId;

    /**
     * 市区
     */
    @Excel(name = "市区")
    private Long cityId;

    /**
     * 区县
     */
    @Excel(name = "区县")
    private Long countyId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date publishTime;

    /**
     * 同步状态
     */
    @Excel(name = "同步状态")
    private Integer syncStatus;

    /**
     * 来源
     */
    @Excel(name = "来源")
    private Integer origin;
    /**
     * 是否存在下载地址
     * 0： 不存在 1： 存在
     */
    private Integer isDownLoad;
    /**
     * 描述
     */
    private String description;

    /**
     * 绘本素材显示列表
     */
    private List<ApMaterial> apMaterials;
    /**
     * 绘本素材下载对象
     */
    private ApDownload apDownload;

    public List<ApMaterial> getApMaterials() {
        return apMaterials;
    }

    public void setApMaterials(List<ApMaterial> apMaterials) {
        this.apMaterials = apMaterials;
    }

    public ApDownload getApDownload() {
        return apDownload;
    }

    public void setApDownload(ApDownload apDownload) {
        this.apDownload = apDownload;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getIsDownLoad() {
        return isDownLoad;
    }

    public void setIsDownLoad(Integer isDownLoad) {
        this.isDownLoad = isDownLoad;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setAuthorId(Long authorId) {
        this.authorId = authorId;
    }

    public Long getAuthorId() {
        return authorId;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setLayout(Integer layout) {
        this.layout = layout;
    }

    public Integer getLayout() {
        return layout;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    public Integer getFlag() {
        return flag;
    }

    public void setLabels(String labels) {
        this.labels = labels;
    }

    public String getLabels() {
        return labels;
    }

    public void setLikes(Integer likes) {
        this.likes = likes;
    }

    public Integer getLikes() {
        return likes;
    }

    public void setCollection(Integer collection) {
        this.collection = collection;
    }

    public Integer getCollection() {
        return collection;
    }

    public void setComment(Integer comment) {
        this.comment = comment;
    }

    public Integer getComment() {
        return comment;
    }

    public void setViews(Integer views) {
        this.views = views;
    }

    public Integer getViews() {
        return views;
    }

    public void setProvinceId(Long provinceId) {
        this.provinceId = provinceId;
    }

    public Long getProvinceId() {
        return provinceId;
    }

    public void setCityId(Long cityId) {
        this.cityId = cityId;
    }

    public Long getCityId() {
        return cityId;
    }

    public void setCountyId(Long countyId) {
        this.countyId = countyId;
    }

    public Long getCountyId() {
        return countyId;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setSyncStatus(Integer syncStatus) {
        this.syncStatus = syncStatus;
    }

    public Integer getSyncStatus() {
        return syncStatus;
    }

    public void setOrigin(Integer origin) {
        this.origin = origin;
    }

    public Integer getOrigin() {
        return origin;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("title", getTitle())
                .append("authorId", getAuthorId())
                .append("authorName", getAuthorName())
                .append("channelId", getChannelId())
                .append("channelName", getChannelName())
                .append("layout", getLayout())
                .append("flag", getFlag())
                .append("labels", getLabels())
                .append("likes", getLikes())
                .append("collection", getCollection())
                .append("comment", getComment())
                .append("views", getViews())
                .append("provinceId", getProvinceId())
                .append("cityId", getCityId())
                .append("countyId", getCountyId())
                .append("createdTime", getCreatedTime())
                .append("publishTime", getPublishTime())
                .append("syncStatus", getSyncStatus())
                .append("origin", getOrigin())
                .toString();
    }
}
